import request from "../util/require"


/**
 * @description: 获取喜欢列表
 * @param {number} fileId -1全部，fileId表示单个
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function getFavourite(fileId: number){
    return request.get("/api/favourite",{
        params: {
            fileId
        }
    })
}

/**
 * @description: 添加喜欢记录
 * @param {number} fileId
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function addFavourite(fileId: number){
    return request.post("/api/favourite",{
        fileId
    })
}

/**
 * @description: 删除喜欢记录
 * @param {number} favouriteId
 * @return {*}
 * @author: tao wenbo 2419421809@qq.com
 */
export function deleteFavourite( favouriteId: number ){
    return request.delete(`/api/favourite/${favouriteId}`)
}

